package com.rh.manage.runner;

import com.rh.manage.ao.LoadContextAO;
import com.rh.manage.constants.FrameCategoryEnum;
import com.rh.manage.service.ContainerService;
import com.rh.manage.service.GitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 启动主窗口
 */
@Component
public class LoadingMainFrameRunner implements ApplicationRunner {

    @Autowired
    private ContainerService containerService;
    @Autowired
    private GitService gitService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        // git同步
        gitService.pullOpt();
        // 启动窗口
        LoadContextAO ao = new LoadContextAO();
        ao.setFrameCategoryEnum(FrameCategoryEnum.PRO_MANAGE);
        containerService.loadContext(ao);
    }
}
